#include <iostream>
#include <cstring>
#include <cstdio>
#include <math.h>
using namespace std;


int main(){
	int letter=0;
	int blank=0;
	int digit=0;
	int other=0;
	int n;
	cin>>n;
	char s;
	cin>>s;
	if(s>'a' && s<'z' || s>'A' && s<'Z'){
		letter++;
	}
	else if(s==' '){
		blank++;
	}
	else if(s>'1' && s<'9'){
		digit++;
	}
	else{
		other++;	
	}

	cout<<letter<<endl;
	cout<<blank<<endl;
	cout<<digit<<endl;
	cout<<other<<endl;
	
	
	
}
